import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/Home/index.vue'
import Editor from '@/components/Editor/index.vue'
import Article from '@/components/Article/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home,
      redirect: '/home/article',
      children: [
        {
          path: 'article',
          component: Article
        },
        {
          path: 'editor/:uid?',
          component: Editor
        }
      ]
    }
  ]
})

export default router
